#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int pre = -1, count = 1, max=1,t, n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> t;
		if (t == pre + 1)
		{
			count++;
		}
		else
		{
			if (count > max)
			{
				max = count;
			}
				count = 1;
		}
			pre = t;
	}
	cout << max << endl;
	return 0;
}